# Author fengzhilaoling
# coding=utf-8
# @Time    : 2020/10/2 上午11:52
# @Site    : 
# @File    : manage.py
# @Software: PyCharm
# @contact: fengzhilaoling@163.com
from flask_script import Manager  # flask脚本的扩展库
from flask_migrate import MigrateCommand
from APP import create_app
import os

# 电脑上有一个FLASK_ENV的环境变量. 表明你的电脑到底是测试还是开发
env = os.environ.get("FLASK_ENV", "default")
app = create_app(env)  # 获取app
manager = Manager(app=app)  # 使用manager管理app
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
